Set nearest-neighbor EBSD resampling, and fix ntot calculation in texure.py#33
Merged
AHartmaier merged 1 commit intoICAMS:masterfrom Apr 9, 2026
Merged
Set nearest-neighbor EBSD resampling, and fix ntot calculation in texure.py#33AHartmaier merged 1 commit intoICAMS:masterfrom
AHartmaier merged 1 commit intoICAMS:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1, The function resample_ebsd_to_rect_grid() in ebsd_hex_grid.py has the defaults parameters k_phase=7, k_iq=7, k_quat=9. I changed to k_phase=1, k_iq=1, k_quat=1.
This makes the hex to rect resampling based on nearest neighbor, so each new pixel takes the value of the closest original EBSD point, instead of mixing several nearby points.
2, I also fixed one error in merge_nodes() in texure.py.
The original code used ntot = len(G.nodes), but that is the number of graph nodes, not the total number of pixels in the two merged grains. It should be:
npix1 = G.nodes[node1]['npix']
npix2 = G.nodes[node2]['npix']
ntot = npix1 + npix2
The merged grain size should be the sum of the two grain pixel counts, which is also needed for the correct weighted update of ori_av.